<template>
    <view class="container">
        <header-bar :config="config"></header-bar>
        <view class="main" v-if="userInfo">
            <easy-cell-item
                :showArrowRight="false"
                :showIcon="false"
                label="职位"
                :value="userInfo.PositionName"></easy-cell-item>
            <easy-cell-item
                :showArrowRight="false"
                :showIcon="false"
                label="员工代码"
                :value="userInfo.PositionCode"></easy-cell-item>
            <easy-cell-item
                :showArrowRight="false"
                :showIcon="false"
                label="所属分公司"
                :value="`${userInfo.FrameworkName ? userInfo.FrameworkName + '-' : ''}${
                    userInfo.DisName ? userInfo.DisName : ''
                }`"></easy-cell-item>
            <easy-cell-item
                :showArrowRight="false"
                :showIcon="false"
                label="账号"
                :value="userInfo.Tel"></easy-cell-item>
            <easy-cell-item
                :showIcon="false"
                label="姓名"
                :value="userInfo.RealName"
                @click.native="goUpdateName"></easy-cell-item>
            <easy-cell-item
                :showArrowRight="false"
                :showIcon="false"
                label="手机号"
                :value="userInfo.Tel"></easy-cell-item>
        </view>
    </view>
</template>

<script>
import easyCellItem from "@/components/easy/easy-cell-item.vue"
import storage from "@/uni-sub-base/utils/storage.js"
export default {
    components: {
        easyCellItem,
    },
    data() {
        return {
            config: {
                title: "个人信息",
                centerSlot: true,
            },
            userInfo: null,
        }
    },
    mounted() {},
    onShow() {
        this.userInfo = storage.getCache("userInfo")
        console.log(this.userInfo)
    },
    methods: {
        goUpdateName() {
            this.easyGoTo("/pages/me/changeName?name=" + this.userInfo.RealName)
        },
    },
}
</script>

<style lang="scss" scoped>
.main {
    margin: $app-item-padding;
    border-radius: 8rpx;
    background: #ffffff;
}
</style>
